package com.manage.demo.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.manage.demo.dao.model.StudentInfo;
import com.manage.demo.dao.model.UserInfo;
//import com.manage.demo.dao.model.Users;
//import com.manage.demo.validation.UserParams;

@Mapper
public interface UserMapper {
	// 学生表——学生全部信息
//	@Select("select count(*) from StudentInfo where stu_id is not null")
//	public Integer getCount();
	
	// 登录者信息
	@Select("select * from user_info where user_id=#{user_input} and password=#{pw_input}")
	public UserInfo getUserByCondition(String user_input, String pw_input);
	
	@Select("select name, grade, class_num from student_info where stu_id=#{user_id}")
	public StudentInfo getStudentByCondition(String user_id);
	
	@Select("select a.name,b.course_name from teacher_info as a inner join course_info as b on a.subject=b.course_id where tch_id=#{user_id}")
	public Map<String, Object> getTeacherByCondition(String user_id);
	
}
